#ifndef LOMCLASSHH
#define LOMCLASSHH
#include "lom-typedefs.hh"
#include "lom-property.hh"
#include "lom-value.hh"

namespace lom
{
    class ILomValueFactory;
    class LomClass
    {
	licada::TNameStr name;
	TPropertyVector properties;
	TValueVector defaults; //these could be null
	ILomValueFactory* factory;

    public:
	LomClass();
	LomClass( const licada::TNameStr& _name, ILomValueFactory* factory );
	LomClass( const LomClass& other );
	LomClass& operator=( const LomClass& other );
	virtual ~LomClass();

	void initialize( const licada::TNameStr& _name, ILomValueFactory* factory);
	void setName( const licada::TNameStr& _name );
	void addProperty( const LomProperty& prop );
	void addProperty( const LomProperty& prop, const LomValue& def );
	
	const licada::TNameStr& getName() const { return name; }
	licada::int32 getPropertyIndex( const licada::TNameStr& name, bool throwFail = true ) const;
	const LomProperty& getProperty( licada::int32 index ) const { return properties.at( index ); }
	const LomValue* getDefault( licada::int32 index ) const { return defaults.at( index ); }
	const TPropertyVector& getProperties() const { return properties; }
	const TValueVector& getDefaults() const { return defaults; }

	TPropertyVector& getProperties() { return properties; }
	TValueVector& getDefaults() { return defaults; }
    };

    typedef std::map<licada::TNameStr, LomClass> TNameToClassMap;

}
#endif
